import  { useState } from "react";

export interface FileItem {
    name: string;
    path: string;
    is_dir: boolean;
    size: number;
    timestamp: string;
}
export interface OSSAccess{
  oss_access_id : string;
  oss_key_secret : string;
  region : string;
  bucket : string;
}
export interface OldandNewPassword{
  old_password: string;
  new_password: string;
}
interface User{
  username: string;
  password: string;
}
export interface amountOfStatus{
  successCount: number;
  failCount: number;
}
export interface RouteInfo{
  user: User;
  url: string;
  // oss: OSSAccess;
}

export function UserInterface(){
  const [mongoDBUrl, setMongoDBUrl] = useState("mongodb://localhost:27017/");
  const [user, setUser] = useState<User | undefined>(undefined);
  const [ossAccess, setOssAccess] = useState<OSSAccess | undefined>(undefined);
  const [routeInfo, setRouteInfo] = useState<RouteInfo | undefined>(undefined);
  // const [logInResponse, setLogInResponse] = useState("");
  // const userRef = useRef<User | undefined>(user);

  return{
    mongoDBUrl, setMongoDBUrl,
    user, setUser,
    ossAccess, setOssAccess,
    routeInfo, setRouteInfo,
    // logInResponse, setLogInResponse
  }
}




